import 'package:flutter/material.dart';

/*
* @Package: bean
* @ClassName: sq_lite_bean
* @Author: szj
* @CreateDate: 8/3/21 2:00 PM
* TODO SqLite使用的Bean类
*/
class SqLiteBean {
  int id;

  //类型
  String type;

  //最大的头像地址
  String bodyImageUrl;

  //作者头像地址
  String authorImageUrl;

  //标题
  String title;

  //视频时间
  String videoTime;

  //作者创作时间时间
  String time;

  //视频地址
  String videoUrl;

  //视频地址背景图片
  String background;

  SqLiteBean(
    this.type,
    this.bodyImageUrl,
    this.authorImageUrl,
    this.title,
    this.time,
    this.videoTime,
    this.videoUrl,
    this.background, {
    this.id,
  });

  SqLiteBean.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    type = json['type'];
    bodyImageUrl = json['bodyImageUrl'];
    authorImageUrl = json['authorImageUrl'];
    title = json['title'];
    time = json['time'];
    videoTime = json['videoTime'];
    videoUrl = json['videoUrl'];
    background = json['background'];
  }

  Map<String, dynamic> toMap() {
    return {
      'id': id,
      'type': type,
      'bodyImageUrl': bodyImageUrl,
      'authorImageUrl': authorImageUrl,
      'title': title,
      'time': time,
      'videoTime': videoTime,
      'videoUrl': videoUrl,
      'background': background,
    };
  }

  @override
  String toString() {
    return 'SqLiteBean{id: $id, type: $type, bodyImageUrl: $bodyImageUrl, authorImageUrl: $authorImageUrl, title: $title, time: $time}';
  }
}
